﻿@model UI.Models.ShoppingCart.Cart
@{
    ViewBag.Title = "Shopping cart";
}
<h2>
    Your shopping cart</h2>
<table cellpadding="0" cellspacing="0">
    <tr class="gridHead">
        <td>
            &nbsp;
        </td>
        <td>
            Item ID
        </td>
        <td>
            Product
        </td>
        <td>
            In Stock
        </td>
        <td>
            Price
        </td>
        <td>
            Quantity
        </td>
        <td>
            Subtotal
        </td>
    </tr>
    @foreach (var item in Model.CartItems)
    {
    
        <tr class="gridItem">
            <td>
                <a href="@Url.Action("RemoveItem", "ShoppingCart", new { itemId = item.ItemId })"  style="position:relative ; right: -10% " >
                    <img src="@Url.Content("~/images/buttonRemove.gif")" alt="Remove from Shopping Cart"  style="border: 0 "/></a>
            </td>
            <td>
                @(item.ItemId)
            </td>
            <td>
                @Html.ActionLink(item.Name, "ItemDetails", "Catalog", new { itemId = item.ItemId }, null)
            </td>
            <td>
                @(item.InStock)
            </td>
            <td class="num" >
                @(item.Price)
            </td>
            <td class="num">
                @(item.Quantity)
            </td>
            <td class="num">
                @(item.Subtotal.ToString("c"))
            </td>
        </tr>
        
    }
    <tr class="gridFoot">
        <td colspan="6" style="text-align: right">
       
           Total :
        </td>
        <td class="num">
           @Model.Total.ToString("c")
        </td>
    </tr>
</table>
